﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class Num
    {
        public static void REF(ref int[] arr,ref int min, ref int max, ref int sum, ref int avg) 
        {
            for (int i = 0; i < arr.Length; i++)
            {
                if (arr[i] >= max)
                {
                    max = arr[i];
                }
                else if(arr[i] <= min)
                {
                    min = arr[i];
                }
            }
            for (int i = 0; i < arr.Length; i++)
            {
                sum = sum + arr[i];
            }

            avg = sum / arr.Length;
        }

        public static void OUT(int[] arr, out int min, out int max, out int sum, out int avg)
        {

            sum = 0;
            min = arr[0];
            max = arr[0];
            avg = 0;

            for (int i = 0; i < arr.Length; i++)
            {
                if (arr[i] >= max)
                {
                    max = arr[i];
                }
                else if (arr[i] <= min)
                {
                    min = arr[i];
                }
            }
            for (int i = 0; i < arr.Length; i++)
            {
                sum = sum + arr[i];
            }

            avg = sum / arr.Length;
        }


    }
}
